package top.continew.admin.common.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import top.continew.starter.core.enums.BaseEnum;

import java.util.Arrays;
import java.util.Optional;

/**
 * 通知枚举
 *
 * @author Charles7c
 * @since 2022/12/29 21:59
 */
@Getter
@RequiredArgsConstructor
public enum NotifyStatusEnums implements BaseEnum<String> {
    /**
     * 未通知
     */
    UN_DO("un_do", "未通知"),
    /**
     * 已通知
     */
    DONE("done", "已通知");

    private final String value;
    private final String description;

    public static Optional<NotifyStatusEnums> getByValue(String value){
        return Arrays.stream(NotifyStatusEnums.values()).filter(t -> t.getValue().equals(value)).findFirst();
    }
}
